<?php 
define('_VIEW_MODEL_','admin');
session_start();
$statu = $_SESSION['statu'];
require_once("../init.php");

if(!$statu){
	echo "<script>window.parent.location.href='./index.php'</script>";
}
if(isset($act)&&$act == "upcont"){
	$id = intval($id);
	$va = intval($val);
	$nu = $va==0?1:0;
	$db->Execute("update {$telper}bbs_reply set state = $nu where id=$id");
}
if(isset($page)){
		$page = intval($page);
	}else{
		$page = 1;
	}
$stat = ($page-1)*$adminusernum;
$id  = intval($id);
$num  = $db->GetRow("select count(id) from {$telper}bbs_reply where bbsid = $id ");
$rs= $db->Execute("select * from {$telper}bbs_reply where bbsid = $id order by created desc");
if(!empty($rs)){
	$bbsinfo = $rs->GetArray();
}else{
	$bbsinfo = false;
}
$pageObj = new Page($num['count(id)'],$adminusernum,$smartyObj);
$smartyObj->assign('title',$admintitle);
$smartyObj->assign('adminbbstitle',$replaybbstitle);
$smartyObj->assign('bbsinfo',$bbsinfo);
$smartyObj->display("bbsreplay.tpl");
?>